#pragma once
#include "BaseObject.h"
#include "../SGD Wrappers/SGD_Listener.h"

class Door : public BaseObject, public SGD::Listener
{
public:
	Door();
	~Door();

	virtual void Update(float dt) override;
	virtual void Render() override;
	virtual void HandleCollision(const IBase* pOther) override;
	virtual void HandleEvent(const SGD::Event* pEvent) override;
	
	virtual SGD::Rectangle	GetRect(void)	const;
	virtual int GetType(void) const override { return OBJ_DOOR; }

	void OpenDoor(float dt);
	void CloseDoor(float dt);
	void SetKeyPadEvent(const char* pEvent) { keyPadEvent = pEvent; }
	void SetDoorRect(SGD::Rectangle _door){ door = _door; }

private:
	std::string keyPadEvent;
	SGD::Rectangle door = { m_ptPosition, SGD::Size( 0, 50 ) };
	bool m_bIsOpen = false;
	bool m_bIsLocked = false;

};

